package com.home.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.home.dao.AreaDao;
import com.home.model.Area;
import com.home.service.AreaService;
@Service("areaService")
public class AreaServiceImpl implements AreaService{
	@Autowired
	private AreaDao<Area,Integer> areaDao;

	public AreaDao<Area, Integer> getAreaDao() {
		return areaDao;
	}

	public void setAreaDao(AreaDao<Area, Integer> areaDao) {
		this.areaDao = areaDao;
	}

	public void delete(Area area) {
		this.getAreaDao().delete(area.getId());
	}

	public Area getArea(Integer id) {
		return this.getAreaDao().get(id);
	}

	public List<Area> getList() {
		return this.getAreaDao().getAll();
	}

	public void save(Area area) {
		this.getAreaDao().save(area);
	}

}
